# Maintainer: Ivan Semkin (ivan at semkin dot ru)

pkgname=ubuntu-ui-toolkit-git
_pkgname=ubuntu-ui-toolkit
pkgver=r18037.d7a3b681c
pkgrel=1
pkgdesc='Qt Components for Ubuntu'
url='https://github.com/ubports/ubuntu-ui-toolkit'
arch=(x86_64 i686 armv7h aarch64)
license=(LGPL)
conflicts=(ubuntu-ui-toolkit)
provides=(ubuntu-ui-toolkit)
depends=(qt5-base qt5-quickcontrols lttng-ust libnih qt5-systems qt5-pim qt5-svg qt5-feedback ubuntu-themes qt5-graphicaleffects bluez-libs)
makedepends=(git)
checkdepends=()
source=('git+https://github.com/ubports/ubuntu-ui-toolkit.git#branch=xenial'
        'NoWarns.patch'
        'dpkg.patch')
sha256sums=('SKIP'
            '3b8a3165161d5c695a7f3f8f3b08a3de11451b8f52276b5b1856730f0aa557c9'
            '5851aec4b72ddd1556494ab188c6de64ccaa77a1b574a0bd2631916300ac242a')

BUILDENV+=('!check') # It needs a DISPLAY, and I am too tired to set it up now

prepare() {
  cd ${_pkgname}

  patch -Np1 -i "${srcdir}/NoWarns.patch"
  patch -Np1 -i "${srcdir}/dpkg.patch"
}

pkgver() {
  cd ${_pkgname}
  echo "r$(git rev-list --count HEAD).$(git describe --always)"
}

build() {
  cd ${_pkgname}
  qmake CONFIG+=no_docs
  make
}

check() {
  cd ${_pkgname}
  make check TESTARGS="-silent"
}

package() {
  cd ${_pkgname}
  mkdir -p /tmp/runtime-builduser
  XDG_RUNTIME_DIR=/tmp/runtime-builduser make INSTALL_ROOT="${pkgdir}/" install
}
# vim:set ts=2 sw=2 et:
